﻿using System.Threading.Tasks;

namespace Devonline.MessageCenter
{
    /// <summary>
    /// 客户端通道
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IChannelClient<T>
    {
        /// <summary>
        /// 通道接收数据的方法
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task Receive(T t);

        /// <summary>
        /// 通道发送数据的方法
        /// </summary>
        /// <param name="t"></param>
        /// <returns></returns>
        Task Send(T t);

        /// <summary>
        /// 通道退出时的方法
        /// </summary>
        /// <returns></returns>
        Task Abort();
    }
}
